
const aa = {
    template:'<button v-on:click="count++">你点了我 {{ count }} 次，我记住了.</button>',
    data(){
        return {
            count:0
        }
    }
};

Vue.component("counter",{
    template:'<button v-on:click="count++">你点了我 {{ count }} 次，我记住了.</button>',
    data(){
        return {
            count:0
        }
    }
})


    var app = new Vue({
    el: "#app",
        components:{
            counter1:aa // 将定义的对象注册为组件
        },
    data: {
    users:[
{name:'柳岩', gender:'女', age: 21},
{name:'峰哥', gender:'男', age: 18},
{name:'范冰冰', gender:'女', age: 24},
{name:'刘亦菲', gender:'女', age: 18},
{name:'古力娜扎', gender:'女', age: 25}
    ],
        user:{name:'柳岩', gender:'女', age: 21},
        show: true,


},
        watch:{
        show(oldval,newval){
            console.log(oldval,newval)
        }
        }
})


